package com.hc.controller;

import com.hc.Interceptor.DemoInterceptor;
import com.jfinal.aop.Before;
import com.jfinal.aop.ClearInterceptor;
import com.jfinal.core.Controller;

/**
 * @author HuChao http://www.weibo.com/u/2420404910
 * @version 1.0 2015年4月3日 下午2:46:30
 */

@Before(value = { DemoInterceptor.class })
public class HelloController extends Controller {

	@Before(value = { DemoInterceptor.class })
	public void index() {
		String a = getPara(0);
		int b = getParaToInt(1);
		renderJson(a + b);
		// render(new JsonRender(a+b).forIE()); ##for IE
	}
	
	@ClearInterceptor
	public void hello(){
		renderText("hello");
	}

}
